package com.zmn.plat.common.dictionary;

/**
 * 结算节点
 *
 * @author yangshuangping
 * @since 2021-7-1 18:07:17
 */
public enum ChannelSettleNodeEnum {

    /**
     * 1不允许，2允许
     */
    FULFILL(ChannelSettleNodeEnum.Settle_FULFILL, "完成"),
    GET_A_SINGLE(ChannelSettleNodeEnum.Settle_GET_A_SINGLE, "领单");

    /**
     * 1不允许
     */
    public final static int Settle_FULFILL = 1;
    /**
     * 2允许
     */
    public final static int Settle_GET_A_SINGLE = 2;

    private Integer code;
    private String name;

    ChannelSettleNodeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getName(Integer code) {
        ChannelSettleNodeEnum of = of(code);
        return of == null ? null : of.getName();
    }

    public static ChannelSettleNodeEnum of(Integer code) {
        switch (code) {
            case 1:
                return FULFILL;
            case 2:
                return GET_A_SINGLE;
            default:
                return null;
        }
    }
}
